import 'package:flutter/material.dart';
import 'package:flutter_learning/utils/ly_app_color.dart';

class Indicator extends StatelessWidget {
  final Color color;
  final String text;
  final bool isSquare;
  final double size;
  final Color textColor;
  final String? content;

  const Indicator({
    Key? key,
    required this.color,
    required this.text,
    this.content,
    this.isSquare = false,
    this.size = 8,
    this.textColor = const Color(0xff505050),
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 5),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            mainAxisSize: MainAxisSize.min,
            children: [
              Container(
                width: size,
                height: size,
                decoration: BoxDecoration(
                  shape: isSquare ? BoxShape.rectangle : BoxShape.circle,
                  color: color,
                ),
              ),
              const SizedBox(
                width: 5,
              ),
              Text(
                text,
                style: const TextStyle(
                    fontSize: 10,
                    fontWeight: FontWeight.normal,
                    color: AppColor.color999999,
                    overflow: TextOverflow.ellipsis),
              )
            ],
          ),
          Expanded(
            child: Container(
              alignment: Alignment.centerRight,
              child: Text(
                content ?? '',
                style: const TextStyle(fontSize: 10, color: AppColor.color333333),
                overflow: TextOverflow.ellipsis,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
